package org.dromara.visitor.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jakarta.annotation.Resource;
import org.dromara.common.core.domain.R;
import org.dromara.visitor.domain.dto.gate.ThroughGateLogReq;
import org.dromara.visitor.domain.dto.gate.ThroughGateLogResp;
import org.dromara.visitor.service.AccessGateService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 闸机记录
 */
@RestController
@RequestMapping("/vis/gate")
public class AccessGateController {
    @Resource
    private AccessGateService accessGateService;

    /**
     * 访客来访日志
     * @param req
     * @return
     */
    @PostMapping("/getThroughGateLog")
    public R<Page<ThroughGateLogResp>> getThroughGateLog(@RequestBody ThroughGateLogReq req){
        Page<ThroughGateLogResp> page = accessGateService.getThroughGateLog(req);
        return R.ok(page);
    }
}
